package org.example.demo01.controller;

import org.example.demo01.dto.WorkStationQueueDTO;
import org.example.demo01.service.WorkStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/v1/workstations")
public class MesController {

    private final WorkStationService workStationService;

    @Autowired
    public MesController(WorkStationService workStationService) {
        this.workStationService = workStationService;
    }

    @GetMapping("/{workstationId}/queue")
    public ResponseEntity<List<WorkStationQueueDTO>> getWorkstationQueue(
            @PathVariable String workstationId) {
        List<WorkStationQueueDTO> queue = workStationService.getWorkstationQueueByid(workstationId);
        return ResponseEntity.ok(queue);
    }
}